/*
 * Copyright (c) 2018, apexes.net. All rights reserved.
 *
 *         http://www.apexes.net
 *
 */
package net.apexes.maven;

import java.io.IOException;
import java.net.URI;
import java.nio.file.Path;

/**
 * @author hedyn
 */
public interface DownloadCallback {

    /**
     * Invoked when dependency download succeeds
     *
     * @param repositoryUri
     * @param dependency
     * @param dependencyPath
     */
    void onSuccess(URI repositoryUri, Dependency dependency, Path dependencyPath);

    /**
     * Invoked when dependency download fails
     *
     * @param repositoryUri
     * @param dependency
     * @param exception
     */
    void onFailure(URI repositoryUri, Dependency dependency, IOException exception);

    /**
     * Invoked when dependency download succeeds
     *
     * @param dependency Dependency object
     * @param dependencyPath Dependency path
     * @see Dependency
     * @see Path
     */
    void onSuccess(Dependency dependency, Path dependencyPath);

    /**
     * Invoked when dependency download fails
     *
     * @param dependency Dependency object
     * @see Dependency
     */
    void onFailure(Dependency dependency);

}
